package com.wmeimob.fastboot.jiubei.result;

import com.fasterxml.jackson.annotation.JsonInclude;

/**
 * @Description 返回对象实体
 */
public class RestResults<T> {
    public int code;

    private String msg;
    private String description;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private T data;

    public RestResults<T> setCode(RestCode restCode) {
        this.code = restCode.code;
        return this;
    }

    public int getCode() {
        return code;
    }

    public RestResults<T> setCode(int code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public RestResults<T> setMsg(String msg) {
        this.msg = msg;
        this.description = msg;
        return this;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    public T getData() {
        return data;
    }

    public RestResults<T> setData(T data) {
        this.data = data;
        return this;
    }
}
